-
Notifications
You must be signed in to change notification settings - Fork 13.4k
rustdoc: linking to a local proc macro no longer warns #141411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustdoc: linking to a local proc macro no longer warns #141411
Conversation
rustbot has assigned @GuillaumeGomez. Use |
This comment has been minimized.
This comment has been minimized.
f328ab0
to
415dfa7
Compare
Not sure it's a good idea to generalize it. We should only do it for items that can be in multiple namepaces at once (I can only think of macros for this case). |
@GuillaumeGomez why? the fact that an item is in multiple namespaces is already a pretty good indication that it is able to appear in multiple namespaces. i'm not sure why i would want write code that asks "is this item, which appears in multiple namespaces, able to appear in multiple namespaces?" technically tuple structs also appear in multiple namespaces (their constructor is a function), but i'm not sure if rustdoc sees that currently. |
It's mostly for performance reasons. We don't want to check items that are never part of multiple namespaces. |
Well, the code I added isn't run at all on the happy path, only in cases where the lint fires today, but I'll make it so the check is only enabled in proc-macro crates, since that just requires reading a field of TyCtx, and will eliminate the check in even more cases, since linking to a non-local proc macro already works fine (they're only functions in their defining crate). |
@GuillaumeGomez I thought of an edge case that my old solution wasn't handling, so I ended up adding a ui test and rewriting the whole thing. Basically, instead of not emitting the error if there is proc-macro duplication, we instead deduplicate and then continue with the normal logic. this allows us to still provide clean and accurate error messages in the rare case where there is duplication, but there is also actual ambiguity (which is the situation the ui test creates). |
ed73524
to
d688c80
Compare
This comment has been minimized.
This comment has been minimized.
d688c80
to
cea63a6
Compare
Apart from some nits, code looks better now. Making the change earlier is a very good idea. :) |
This comment has been minimized.
This comment has been minimized.
d2e2a64
to
7fc9166
Compare
Looks all good to me! Please squash your commits then I'll r+. |
fixes rust-lang#91274 Co-authored-by: Guillaume Gomez <[email protected]>
7fc9166
to
871327e
Compare
@GuillaumeGomez squashed! |
Thanks! Once CI passed, r=me. @bors delegate=lolbinarycat |
✌️ @lolbinarycat, you can now approve this pull request! If @GuillaumeGomez told you to " |
The job Click to see the possible cause of the failure (guessed by this bot)
|
…ro-91274, r=GuillaumeGomez rustdoc: linking to a local proc macro no longer warns fixes rust-lang#91274 tried to keep the fix general in case we ever have any other kind of item that occupies multiple namespaces simultaniously.
Rollup of 8 pull requests Successful merges: - #140369 (Add data_ptr method to Mutex and RwLock) - #140697 (Split `autodiff` into `autodiff_forward` and `autodiff_reverse`) - #141404 (Improve intrinsic handling in cg_ssa) - #141407 (Refactor the two-phase check for impls and impl items) - #141411 (rustdoc: linking to a local proc macro no longer warns) - #141548 (consider glob imports in cfg suggestion) - #141627 (Drop-build cleanups) - #141670 (Fix ICE in tokenstream with contracts from parser recovery) r? `@ghost` `@rustbot` modify labels: rollup
…ro-91274, r=GuillaumeGomez rustdoc: linking to a local proc macro no longer warns fixes rust-lang#91274 tried to keep the fix general in case we ever have any other kind of item that occupies multiple namespaces simultaniously.
Rollup of 8 pull requests Successful merges: - #140369 (Add data_ptr method to Mutex and RwLock) - #140697 (Split `autodiff` into `autodiff_forward` and `autodiff_reverse`) - #141404 (Improve intrinsic handling in cg_ssa) - #141407 (Refactor the two-phase check for impls and impl items) - #141411 (rustdoc: linking to a local proc macro no longer warns) - #141548 (consider glob imports in cfg suggestion) - #141627 (Drop-build cleanups) - #141670 (Fix ICE in tokenstream with contracts from parser recovery) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 7 pull requests Successful merges: - #140369 (Add data_ptr method to Mutex and RwLock) - #140697 (Split `autodiff` into `autodiff_forward` and `autodiff_reverse`) - #141404 (Improve intrinsic handling in cg_ssa) - #141411 (rustdoc: linking to a local proc macro no longer warns) - #141548 (consider glob imports in cfg suggestion) - #141627 (Drop-build cleanups) - #141670 (Fix ICE in tokenstream with contracts from parser recovery) r? `@ghost` `@rustbot` modify labels: rollup
fixes #91274
tried to keep the fix general in case we ever have any other kind of item that occupies
multiple namespaces simultaniously.